package designMode.compoundPattern;

/**
 * @author LIBOFEI
 * @ClassName RedDuck
 * @description 红鸭子
 * @date 2020/7/1 14:17
 * @Version 1.0
 **/
public class RedDuck implements Quackable {

    Observable observable;

    public RedDuck(){
        observable = new Observable(this);
    }

    @Override
    public void quack() {
        System.out.println("红鸭子叫呱呱呱");
        notifyObservers();
    }

    @Override
    public void registerObserver(Observer observer) {
        observable.registerObserver(observer);
    }

    @Override
    public void notifyObservers() {
        observable.notifyObservers();
    }
}
